/*
 * 书，目录生成函数
 */

function jieGetBlogPostBody(divId, n) {
    $.ajax({
        url: getAjaxBaseUrl() + "postbody/fulltext.aspx",
        data: JSON.stringify({
            postId: n
        }),
        type: "post",
        contentType: "application/json",
        dataType: "text",
        success: function(t) {
            if (t) {
                var i = divId;
                $(i).html(t);
                cb_mathjax_render(i);
                fixPostListBodyFormat();
                markdown_highlight()
            } else
                $(divId).html("")
        }
    })
}

// 书目录

var bookTag = $('#bookTag');
if(bookTag.length > 0) {
    var postId = bookTag.text();
    var mainDiv = $('#main');
    mainDiv.prepend('<div id="book-menu"><div id="book-nav"></div></div>');
    mainDiv.addClass("classMainBook");
    jieGetBlogPostBody("#main #book-menu #book-nav", postId);
}